package com.sqltojson.core;

import java.util.List;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import com.google.common.collect.Lists;

/**
 * Le resultat de la requete.
 */
@XmlRootElement
@XmlType(propOrder={"column",  "row"})
public class Resultat {
	
	/** Les colonnes.*/
	private List<String> column;
	
	/** Les lignes*/
	private List<Row> row; 

	public Resultat() {
	}
	

	public void add(Row create) {
		if(row == null){
			row = Lists.newArrayList();
		}
		row.add(create);
	}
	
	public void addColumnName(String columnName) {
		if(column == null){
			column = Lists.newArrayList();
		}
		column.add(columnName);
		
	}

	public List<String> getColumn() {
		return column;
	}

	public void setColumn(List<String> column) {
		this.column = column;
	}

	public List<Row> getRow() {
		return row;
	}

	public void setRow(List<Row> row) {
		this.row = row;
	}
}
